import request from '@/utils/request'

// 查询考试分类列表
export function listExamCategory(query) {
  return request({
    url: '/exam/examCategory/list',
    method: 'get',
    params: query
  })
}

// 查询考试分类详细
export function getExamCategory(id) {
  return request({
    url: '/exam/examCategory/' + id,
    method: 'get'
  })
}

// 新增考试分类
export function addExamCategory(data) {
  return request({
    url: '/exam/examCategory',
    method: 'post',
    data: data
  })
}

// 修改考试分类
export function updateExamCategory(data) {
  return request({
    url: '/exam/examCategory',
    method: 'put',
    data: data
  })
}

// 删除考试分类
export function delExamCategory(id) {
  return request({
    url: '/exam/examCategory/' + id,
    method: 'delete'
  })
}

//获取考试分类树
export function getExamCategoryTree(id) {
  return request({
    url: '/exam/examCategory/tree/' + id,
    method: 'get'
  })
}

//删除试题分类及其子分类
export function delExamCategoryAndChild(id) {
  return request({
    url: '/exam/examCategory/remove/' + id,
    method: 'delete'
  })
}

//根据分类Id获取分类名称
export function getExamCategoryName(id) {
  return request({
    url: '/exam/examCategory/getCategoryName/' + id,
    method: 'get'
  })
}
